<?php

namespace App\Http\Requests\home;

use App\Http\Requests\Request;

class RegisterRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //验证字段
        
            'accnum' => 'required',
            'pass' => 'required',
            'repass' => 'required|same:pass',   
            'code' => 'required',     
        ];
    }

    public function messages(){
        return [
            'name.required'=>'账号不能为空',
            'pass.required'=>'密码不能为空',
            'repass.required'=>'重复密码不能为空',
            'repass.same'=>'两次密码输入不一致',
            'code.required'=>'验证码不能为空',
            
        ];
    }
}
